(function () {
    'use strict';
    var global$7 = tinymce.util.Tools.resolve('tinymce.PluginManager');
    var setupMenuItems = function (editor) {
        editor.ui.registry.addMenuItem('hlValue', {
            text: 'hlValue',
            icon: 'new-tab',
            onAction: function (){
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                editor.execCallback('updateHlValue', editor,tdObject);
                editor.undoManager.add();
            }
        });
        editor.ui.registry.addMenuItem('removeHlValue', {
            icon: 'unlink',
            text: 'removeHlValue',
            onAction: function () {
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                editor.execCallback('updateHlValue', editor,tdObject);
                editor.undoManager.add();
            },
        });
    };
    var setupContextMenu = function (editor) {
        editor.ui.registry.addContextMenu('hlValue', {
            update: function (element) {
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                if(!tdObject) return "";
                var trObject = editor.dom.getParent(tdObject, "tr");
                if(trObject.className.indexOf("childTr") == -1){
                    return "";
                }
                if(tdObject.className.indexOf("hlValue") != -1) return "removeHlValue";
                return "hlValue";
            }
        });
    };
    function Plugin () {
        global$7.add('hlValue', function (editor) {
            setupMenuItems(editor);
            setupContextMenu(editor);
        });
    }

    Plugin();
}());